import request from '@/utils/request';

// 任务列表
export function getTaskList(params) {
  return request({
    url: '/task/selectMyTask',
    method: 'GET',
    params
  });
}

// 判断任务状态
export function getSelectTaskStatus(params) {
  return request({
    url: '/task/selectTaskStatus',
    method: 'GET',
    params
  });
}

// 判断当前登录人是否是任务或项目的创建人或负责人
export function getSelectTypeByUserId(params) {
  return request({
    url: '/task/selectTypeByUserId',
    method: 'GET',
    params
  });
}

// 修改任务状态
export function updateTaskStatus(params) {
  return request({
    url: '/task/updateTaskStatus',
    method: 'GET',
    params
  });
}

// 结束任务时存问卷数据
export function resultTesting(params) {
  return request({
    url: '/testing/resultTesting',
    method: 'GET',
    params
  });
}

// 结束任务时存问卷汇总
export function resultBigTesting(params) {
  return request({
    url: '/testing/resultBigTesting',
    method: 'GET',
    params
  });
}

// 删除任务
export function deleteTask(params) {
  return request({
    url: '/task/deleteTask',
    method: 'GET',
    params
  });
}

// 新增任务
export function addTask(data) {
  return request({
    url: '/task/addtask',
    method: 'post',
    data
  });
}

// 管理员获取项目名称
export function getProjectName() {
  return request({
    url: '/project/name',
    method: 'post'
  });
}

// 学生老师获取项目名称
export function getTaskByprojectIdList(params) {
  return request({
    url: '/task/taskByprojectIdList',
    method: 'get',
    params
  });
}

// 获取所有任务名称
export function getAllTaskName(params) {
  return request({
    url: '/task/selectAllTaskName',
    method: 'get',
    params
  });
}

// 获取所有角色名称
export function getSelectAllRoleName(params) {
  return request({
    url: '/task/selectAllRoleName',
    method: 'get',
    params
  });
}

// 根据id获取项目迭代名称
export function getIteration(params) {
  return request({
    url: '/project/iteration',
    method: 'post',
    params
  });
}

// 根据id获取项目模块名称
export function getModuleName(params) {
  return request({
    url: '/project/module',
    method: 'post',
    params
  });
}

// 根据id获取项目属性
export function getSelectProjectType(params) {
  return request({
    url: '/project/selectProjectType',
    method: 'post',
    params
  });
}

// 获取用户名字和角色名字列表
export function getSelectRoleName(data) {
  return request({
    url: '/task/selectRoleName',
    method: 'post',
    data
  });
}

// 获取标签列表
export function getSelectLabel() {
  return request({
    url: '/label/selectLabel',
    method: 'get'
  });
}

// 获取审核人问卷答案
export function getSelectNowAnswerByTaskId(params) {
  return request({
    url: '/taskResultChecked/selectNowAnswerByTaskId',
    method: 'get',
    params
  });
}

// 查询上个审核人的审核原因
export function getSelectLastExamine(params) {
  return request({
    url: '/taskResultChecked/selectLastExamine',
    method: 'get',
    params
  });
}

// 获取评分表名称
export function getEvaluationName(params) {
  return request({
    url: '/project/evaluation/name',
    method: 'get',
    params
  });
}

// 文件上传
export function uploadFile(data) {
  return request({
    url: '/file/upload',
    method: 'post',
    data
  });
}

// 根据文件id删除文件
export function deleteFile(params) {
  return request({
    url: '/file/delete',
    method: 'post',
    params
  });
}

// 获取任务概况
export function getSelectTaskSummary(params) {
  return request({
    url: '/task/selectTaskSummary',
    method: 'get',
    params
  });
}

// 判断该任务所属的项目是否复制项目
export function getSelectTaskByProject(params) {
  return request({
    url: '/task/selectTaskByProject',
    method: 'get',
    params
  });
}

// 获取任务概况交互结果
export function getSelectResult(params) {
  return request({
    url: '/taskResult/selectResult',
    method: 'get',
    params
  });
}

// 获取当前登录人属性
export function getSelectType(params) {
  return request({
    url: '/taskResult/selectType',
    method: 'get',
    params
  });
}

// 任务概况开始按钮
export function taskStart(params) {
  return request({
    url: '/task/taskStart',
    method: 'get',
    params
  });
}

// 任务概况重启按钮
export function restartTask(params) {
  return request({
    url: '/task/restartTask',
    method: 'get',
    params
  });
}

// 任务交互结果状态
export function updateStauts(params) {
  return request({
    url: '/taskResult/updateStauts',
    method: 'get',
    params
  });
}

// 执行人问卷提交
export function submitTesting(data) {
  return request({
    url: '/testing/submitTesting',
    method: 'post',
    data
  });
}

// 审核人问卷提交
export function submitReviewersTesting(data) {
  return request({
    url: '/testing/submitReviewersTesting',
    method: 'post',
    data
  });
}

// 审核提交
export function addtrc(data) {
  return request({
    url: '/taskResultChecked/addtrc',
    method: 'post',
    data
  });
}

// 查询审核人是否全部审核完，并修改状态
export function getSelectReviewerStatus(params) {
  return request({
    url: '/taskResultChecked/selectReviewerStatus',
    method: 'get',
    params
  });
}

// 判断当前登录人的上一个审核人是否审核
export function getSelectLastApproveIs(params) {
  return request({
    url: '/task/selectLastApproveIs',
    method: 'get',
    params
  });
}

// 编辑任务概况
export function updateTaskSummary(data) {
  return request({
    url: '/task/updateTaskSummary',
    method: 'post',
    data
  });
}

// 查询任务介绍
export function getSelectIntroduce(params) {
  return request({
    url: '/task/selectIntroduce',
    method: 'get',
    params
  });
}

// 下载任务附件
export function getByUrl(params) {
  return request({
    url: '/file/byUrl',
    method: 'get',
    params
  });
}

// 根据任务id查询问卷
export function getSelectTesting(params) {
  return request({
    url: '/testing/selectTesting',
    method: 'get',
    params
  });
}

// 查询能力
export function getSelectAbility(params) {
  return request({
    url: '/testing/selectAbility',
    method: 'get',
    params
  });
}

// 新增执行人问卷
export function addTesting(data) {
  return request({
    url: '/testing/addTesting',
    method: 'post',
    data
  });
}

// 编辑执行人问卷
export function updateTesting(data) {
  return request({
    url: '/testing/updateTesting',
    method: 'post',
    data
  });
}

// 编辑任务结果
export function updateResult(data) {
  return request({
    url: '/taskResult/updateResult',
    method: 'post',
    data
  });
}

// 评论---------------------------------
// 新增评论
export function addComment(data) {
  return request({
    url: '/comment/addComment',
    method: 'post',
    data
  });
}

// 新增评论
export function deleteComment(params) {
  return request({
    url: '/comment/deleteComment',
    method: 'post',
    params
  });
}

// 周报---------------------------------
// 查询周报列表
export function getSelectWeekly(data) {
  return request({
    url: '/weekly/selectWeekly',
    method: 'post',
    data
  });
}

// 查询周报详情
export function getSelectWeeklyAll(params) {
  return request({
    url: '/weekly/selectWeeklyAll',
    method: 'get',
    params
  });
}

// 获取创建人头像名称
export function getSelectPersonal(params) {
  return request({
    url: '/user/selectPersonal',
    method: 'get',
    params
  });
}

// 新增周报
export function addWeekly(data) {
  return request({
    url: '/weekly/addWeekly',
    method: 'post',
    data
  });
}

// 编辑周报
export function updateWeekly(data) {
  return request({
    url: '/weekly/updateWeekly',
    method: 'post',
    data
  });
}

// 修改周报审核状态
export function updateStatus(data) {
  return request({
    url: '/weekly/updateStatus',
    method: 'post',
    data
  });
}

// 查询关联任务
export function getSelectAllTask(params) {
  return request({
    url: '/weekly/selectAllTask',
    method: 'get',
    params
  });
}

// 查询审核人
export function getSelectAllReviewerUser(data) {
  return request({
    url: '/weekly/selectAllReviewerUser',
    method: 'post',
    data
  });
}

// 判断当前登录人是否是审核人1是2否
export function getSelectUserType(params) {
  return request({
    url: '/weekly/selectUserType',
    method: 'get',
    params
  });
}

// 周报审核
export function reviewerWeekly(data) {
  return request({
    url: '/weekly/reviewerWeekly',
    method: 'post',
    data
  });
}
